home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Draw / CCE_Particle.as < prev    next >
Text File  |  2011-08-19  |  2KB  |  85 lines

  1. package Local.Draw
  2. {
  3.    import flash.display.Graphics;
  4.    import flash.geom.Point;
  5.    
  6.    public class CCE_Particle
  7.    {
  8.       
  9.       public static var mAllocateID:int = 0;
  10.       
  11.       public static const zPoint:Point = new Point(0,0);
  12.        
  13.       
  14.       public var mNext:CCE_Particle;
  15.       
  16.       public var mDelay:int;
  17.       
  18.       public var mID:String;
  19.       
  20.       public var mDelta:Point;
  21.       
  22.       public var mDecay:Number = 0.98;
  23.       
  24.       public var mAlpha:Number;
  25.       
  26.       public var mPosition:Point;
  27.       
  28.       public function CCE_Particle(param1:Point, param2:Point)
  29.       {
  30.          mDecay = 0.98;
  31.          super();
  32.          mID = "p" + ++mAllocateID;
  33.          mPosition = param1;
  34.          mDelta = param2;
  35.          mDecay = 0.95;
  36.          ┬º┬ºpush(┬º┬ºfindproperty(mDelay));
  37.          ┬º┬ºpush(Math.random() * 5);
  38.          if(true)
  39.          {
  40.             ┬º┬ºpush(┬º┬ºpop() + 5);
  41.          }
  42.          ┬º┬ºpop().mDelay = ┬º┬ºpop();
  43.          mAlpha = 1;
  44.       }
  45.       
  46.       public function Render(param1:Graphics) : void
  47.       {
  48.          param1.beginFill(16777215,mAlpha);
  49.          param1.drawCircle(mPosition.x,mPosition.y,mDelta.length);
  50.       }
  51.       
  52.       public function DrawLine(param1:Graphics, param2:Point, param3:Point) : void
  53.       {
  54.          param1.moveTo(param2.x,param2.y);
  55.          param1.lineTo(param3.x,param3.y);
  56.       }
  57.       
  58.       public function DrawPoint(param1:Graphics, param2:Point) : void
  59.       {
  60.          var _loc3_:Number = NaN;
  61.          _loc3_ = 2;
  62.          param1.moveTo(param2.x - _loc3_,param2.y - _loc3_);
  63.          param1.lineTo(param2.x + _loc3_,param2.y + _loc3_);
  64.          param1.moveTo(param2.x + _loc3_,param2.y - _loc3_);
  65.          param1.lineTo(param2.x - _loc3_,param2.y + _loc3_);
  66.       }
  67.       
  68.       public function Process() : Boolean
  69.       {
  70.          mPosition.x += mDelta.x;
  71.          mPosition.y += mDelta.y;
  72.          mDelta.x *= mDecay;
  73.          mDelta.y *= mDecay;
  74.          ┬º┬ºpush(┬º┬ºfindproperty(mAlpha));
  75.          ┬º┬ºpush(mAlpha);
  76.          if(true)
  77.          {
  78.             ┬º┬ºpush(┬º┬ºpop() * mDecay);
  79.          }
  80.          ┬º┬ºpop().mAlpha = ┬º┬ºpop();
  81.          return mAlpha >= 0.2;
  82.       }
  83.    }
  84. }
  85.